package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.AddressBook;
import com.sky.entity.Orders;
import com.sky.result.PageResult;
import com.sky.vo.SalesTop10ReportVO;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrdersMapper {
    /**
     * 用户下单
     */
    void insert(Orders orders);

     //查询订单
    Orders getByNumber(String number);

    /**
     * 更新订单
     */
    void update(Orders orders);

    List<Orders> getByStatusAndOrderTimeLT(Integer status, LocalDateTime orderTime);

    /**
     *根据订单id 查询订单
     */
    Orders getById(Long id);


    /**
     * 查询历史订单
     */
    Page<Orders>  getHistoryOrders(OrdersPageQueryDTO ordersPageQueryDTO);

    /**
     * 营业额统计
     */
    Double sumByMap(Map map);

    /**
     * 订单统计
     */
    Integer countByMap(Map map);

    /**
     * 销量排名top10
     */
    List<GoodsSalesDTO> getSalesTop10(LocalDateTime begin, LocalDateTime end);
}
